package com.cdie.myschool.controller;

import com.cdie.myschool.common.R;
import com.cdie.myschool.domain.dto.TeachingInformationDTO;
import com.cdie.myschool.domain.entity.TimetableOld;
import com.cdie.myschool.domain.vo.TeachingInformationVO;
import com.cdie.myschool.service.TeacherTimeTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 雷金臣199000347
 * @date 2022/10/9 - 2:27
 */
@RestController
public class TeacherTimeTableController {
    @Autowired
    private TeacherTimeTableService teacherTimeTableService;
    @RequestMapping("/timetableTest")
    public R<TimetableOld> TimetableOld(){
        R<TimetableOld> r=teacherTimeTableService.TimetableOld();
        if(r!=null){
            return R.Success("awards表插入成功！！！");
        }
        return R.Failed("awards表插入失败！！！");
    }

    @RequestMapping("/teachingInformation")
    public R<TeachingInformationVO> TeachingInformation(@RequestBody TeachingInformationDTO teachingInformationDTO){
        R<TeachingInformationVO> r=teacherTimeTableService.getTeachingInfo(teachingInformationDTO);
        return R.Success("授课信息查询成功！",r);
    }
}
